package edu.uc.ui.ctrl25;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

import javassist.SerialVersionUID;
@Repository("AuthorizationInterceptor")
@Scope("prototype")
public class AuthorizationInterceptor extends AbstractInterceptor {
	
	@Override
	public String intercept(ActionInvocation arg0) throws Exception {
		if(arg0.getInvocationContext().getSession().get("loginuser") == null){
			return "login";
		}
		else {
			
			return arg0.invoke();
		}
	}
	

}
